import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
//引入路径模块
import path from 'path'

// https://vite.dev/config/
export default defineConfig({
  resolve: {
    alias: {
      "@": path.resolve(__dirname, "src"),
    },
  },
  server: {
    proxy: {
      '/hotel': {
        target: 'http://www.thinkphp.com/hotel', // 本地
        // target: 'https://thinkphp.lijingji.top/hotel', // 线上
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/hotel/, ''),
      },
    }
  },
  plugins: [react()],
})

